package com.springmvcstartup.service;

import com.springmvcstartup.domain.Person;

import java.util.List;

/**
 * PersonService is the Service that offers an interface for operations
 * related to the person functionality.
 * <p/>
 *
 * @author Ceren Akkan
 */
public interface PersonService {
    /**
     * New person is created with the provided person data.
     *
     * @param person the person object to be created
     * @return the created person
     */
    Person create(Person person);

    /**
     * Return the content for the provided id.
     *
     * @param personId
     * @return the existing content
     */
    Person get(Long personId);

    /**
     * Return the list of person.
     *
     * @return list of {@link Person}
     */
    List<Person> get();

    /**
     * Deletes an existing {@link com.springmvcstartup.domain.Person} object.
     *
     * @param personId ID of the person to delete
     */
    void delete(Long personId);

    /**
     * Updates an existing {@link com.springmvcstartup.domain.Person} object.
     *
     * @param person the person to be updated
     * @return the updated person
     */
    Person update(Person person);

}
